Telegram Group & Telegram Channel
This media is not supported in your browser
VIEW IN TELEGRAM
🖥 Полезный хак для Python разработчиков.


import dis

def explain_bytecode(fn):
print(f"Анализ байткода функции: {fn.__name__}\n")
dis.dis(fn)

Пример:
def tricky(x):
return x * 2 + 1 if x > 0 else x - 1

explain_bytecode(tricky)

Этот хак показывает байткод Python-функции, позволяя заглянуть под капот интерпретатора. Используется для:

• отладки «странного» поведения функций
• анализа производительности на уровне Python VM
• изучения, как Python интерпретирует тернарные выражения, замыкания, генераторы и т. д.

Модуль dis встроен в стандартную библиотеку и часто игнорируется — но это мощный инструмент для продвинутых разработчиков и авторов интерпретаторов.



@Python_Community_ru



tg-me.com/Python_Community_ru/2643
Create:
Last Update:

🖥 Полезный хак для Python разработчиков.


import dis

def explain_bytecode(fn):
print(f"Анализ байткода функции: {fn.__name__}\n")
dis.dis(fn)

Пример:
def tricky(x):
return x * 2 + 1 if x > 0 else x - 1

explain_bytecode(tricky)

Этот хак показывает байткод Python-функции, позволяя заглянуть под капот интерпретатора. Используется для:

• отладки «странного» поведения функций
• анализа производительности на уровне Python VM
• изучения, как Python интерпретирует тернарные выражения, замыкания, генераторы и т. д.

Модуль dis встроен в стандартную библиотеку и часто игнорируется — но это мощный инструмент для продвинутых разработчиков и авторов интерпретаторов.



@Python_Community_ru

BY Python Community


Share with your friend now:
tg-me.com/Python_Community_ru/2643

View MORE
Open in Telegram


Python Community Telegram | DID YOU KNOW?

Date: |

Export WhatsApp stickers to Telegram on iPhone

You can’t. What you can do, though, is use WhatsApp’s and Telegram’s web platforms to transfer stickers. It’s easy, but might take a while.Open WhatsApp in your browser, find a sticker you like in a chat, and right-click on it to save it as an image. The file won’t be a picture, though—it’s a webpage and will have a .webp extension. Don’t be scared, this is the way. Repeat this step to save as many stickers as you want.Then, open Telegram in your browser and go into your Saved messages chat. Just as you’d share a file with a friend, click the Share file button on the bottom left of the chat window (it looks like a dog-eared paper), and select the .webp files you downloaded. Click Open and you’ll see your stickers in your Saved messages chat. This is now your sticker depository. To use them, forward them as you would a message from one chat to the other: by clicking or long-pressing on the sticker, and then choosing Forward.

Among the actives, Ascendas REIT sank 0.64 percent, while CapitaLand Integrated Commercial Trust plummeted 1.42 percent, City Developments plunged 1.12 percent, Dairy Farm International tumbled 0.86 percent, DBS Group skidded 0.68 percent, Genting Singapore retreated 0.67 percent, Hongkong Land climbed 1.30 percent, Mapletree Commercial Trust lost 0.47 percent, Mapletree Logistics Trust tanked 0.95 percent, Oversea-Chinese Banking Corporation dropped 0.61 percent, SATS rose 0.24 percent, SembCorp Industries shed 0.54 percent, Singapore Airlines surrendered 0.79 percent, Singapore Exchange slid 0.30 percent, Singapore Press Holdings declined 1.03 percent, Singapore Technologies Engineering dipped 0.26 percent, SingTel advanced 0.81 percent, United Overseas Bank fell 0.39 percent, Wilmar International eased 0.24 percent, Yangzijiang Shipbuilding jumped 1.42 percent and Keppel Corp, Thai Beverage, CapitaLand and Comfort DelGro were unchanged.

Python Community from nl


Telegram Python Community
FROM USA